10 HOME
20 PRINT CHR$(4);"PR#3"
21 DIM B(20,80)
22 DIM C(1510)
23 X1=10:Y1=42:BB=0:B=0

30 ONERR GOTO 31


31 INVERSE:VTAB 1:HTAB 30:PRINT"MAZE PAINTER TOOL":VTAB 23:HTAB 1:PRINT"                                                                               ":VTAB 23:HTAB 26:PRINT"PRESS ANY KEY TO BE CONTINUE"
32 VTAB 23:HTAB 55:GET Z$:VTAB 23:HTAB 55:PRINT Z$:NORMAL

33 ONERR GOTO 34

34 HOME:INVERSE:VTAB 23:HTAB 1:PRINT" PLEASE INSERT A DATA DISK IN SLOT 6 DRIVE 2,THEN PRESS <SPC> TO BE CONTINUE. ":VTAB 23:HTAB 79:GET G$:VTAB 23:HTAB 79:PRINT G$:NORMAL

35 IF G$<>" " THEN 34

36 NORMAL:D2=1:GOSUB 15800


39 NORMAL:HOME:ONERR GOTO 22200


40 VTAB 10:HTAB 40:PRINT " "
45 VTAB 10:HTAB 40:PRINT "M"
50 INVERSE:VTAB 10:HTAB 42:PRINT "$":NORMAL
52 VTAB 20:HTAB 6:PRINT"Y":VTAB 20:HTAB 10:PRINT"I":VTAB 20:HTAB 15:PRINT"       ":VTAB 20:HTAB 32:PRINT"S - SAVE MAZE":VTAB 20:HTAB 66:PRINT"DOLLAR :    0"
54 VTAB 21 :HTAB 5:PRINT"G H":VTAB 21:HTAB 9:PRINT"J K":VTAB 21:HTAB 15:PRINT"F - PAINTER":VTAB 21:HTAB 32:PRINT"L - LOAD MAZE":VTAB 21:HTAB 47:PRINT"X - CATALOG":VTAB 21:HTAB 66:PRINT"  STEP :    0"
56 VTAB 22 :HTAB 6:PRINT"B":VTAB 22:HTAB 10:PRINT"M":VTAB 22:HTAB 15:PRINT"Q - QUIT":VTAB 22:HTAB 32:PRINT"C - CLEAR SCN":VTAB 22:HTAB 66:PRINT"RESTEP :    0"

58 INVERSE:VTAB 23:HTAB 1:PRINT"                                                                               ":NORMAL
59 GOSUB 1200

60 R1=0:NO=0
62 VTAB 10:HTAB 40:PRINT"M":INVERSE:VTAB X1:HTAB Y1:PRINT "$":VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL
65 IF A$="Q" THEN 7000

74 IF A$=CHR$(25) THEN X2=X1-1:Y2=Y1:GOSUB 58000
75 IF A$=CHR$(7) THEN X2=X1:Y2=Y1-1:GOSUB 58000
76 IF A$=CHR$(8) THEN X2=X1:Y2=Y1+1:GOSUB 58000
77 IF A$=CHR$(2) THEN X2=X1+1:Y2=Y1:GOSUB 58000

78 IF A$="I" THEN X2=X1-1:Y2=Y1:GOSUB 58100
80 IF A$="J" THEN X2=X1:Y2=Y1-1:GOSUB 58100
90 IF A$="K" THEN X2=X1:Y2=Y1+1:GOSUB 58100
95 IF A$="M" THEN X2=X1+1:Y2=Y1:GOSUB 58100

100 IF A$="Y" THEN X2=X1-1:Y2=Y1:GOSUB 58200
110 IF A$="G" THEN X2=X1:Y2=Y1-1:GOSUB 58200
120 IF A$="H" THEN X2=X1:Y2=Y1+1:GOSUB 58200
130 IF A$="B" THEN X2=X1+1:Y2=Y1:GOSUB 58200


162 IF A$="F" THEN 30000


172 IF A$="S" THEN 15000
180 IF A$="L" THEN 15100
182 IF A$="C" THEN 15500
184 IF A$="X" THEN 15800


191 IF A$=CHR$(6) THEN 33000

200 GOTO 60

 

650 INVERSE:VTAB 23:HTAB 1:PRINT"              WAITING                       ":NORMAL

660 FOR I=0 TO 20
670 FOR J=0 TO 80
680 IF B(I,J)<>1 THEN B(I,J)=0
690 NEXT J
700 NEXT I
 

900 IF H2>9 THEN N2=N2-1
910 IF H2>99 THEN N2=N2-1
920 IF H2>999 THEN N2=N2-1
930 VTAB N1:HTAB N2: PRINT H2
940 RETURN




1000 IF X2<1 THEN X2=19
1010 IF X2>19 THEN X2=1
1020 IF Y2<1 THEN Y2=79
1030 IF Y2>79 THEN Y2=1
1040 RETURN

1100 IF B(X1,Y1)=0 THEN BB=BB+1
1110 RETURN 

1150 IF B(X1,Y1)=1 THEN BB=BB-1
1160 RETURN

1200 IF BB<0 THEN BB=0
1210 IF BB<10 AND BB>-1 THEN NN1=78
1220 IF BB<100 AND BB>9 THEN NN1=77
1230 IF BB<1000 AND BB>99 THEN NN1=76
1240 IF BB<10000 AND BB>999 THEN NN1=75
1242 VTAB 20:HTAB 75:PRINT"    "
1260 VTAB 20:HTAB NN1:PRINT BB
1270 RETURN

1400 N1=21:N2=78
1410 IF S1>9 THEN N2=N2-1
1420 IF S1>99 THEN N2=N2-1
1430 IF S1>999 THEN N2=N2-1
1440 VTAB N1:HTAB N2: PRINT S1
1450 RETURN


1500 IF XP<1 THEN XP=1
1510 IF XP>19 THEN XP=19
1520 IF YP<1 THEN YP=1
1530 IF YP>79 THEN YP=79
1540 RETURN



7000 HOME:PRINT CHR$(4);"CATALOG"+",D1,S6":END


9100 F$="COPYTANK"



9108 PRINT CHR$(4);"OPEN";F$
9109 PRINT CHR$(4);"DELETE";F$

9112 PRINT CHR$(4);"OPEN";F$
9120 PRINT CHR$(4);"WRITE";F$

9130 FOR I=X2 TO XS
9140 FOR J=Y2 TO YS

9142 IF U=1 THEN PRINT B(I,J):B(I,J)=0:GOTO 9160

9150 PRINT B(I,J)
9160 NEXT J
9170 NEXT I
9180 PRINT CHR$(4);"CLOSE";F$

9198 GOSUB 62408

9199 RETURN

 


9200 F$="COPYTANK"



9208 PRINT CHR$(4);"OPEN";F$
9209 PRINT CHR$(4);"DELETE";F$

9212 PRINT CHR$(4);"OPEN";F$
9220 PRINT CHR$(4);"WRITE";F$

9230 FOR I=X2 TO XS
9240 FOR J=YS TO Y2

9242 IF U=1 THEN PRINT B(I,J):B(I,J)=0:GOTO 9260

9250 PRINT B(I,J)
9260 NEXT J
9270 NEXT I
9280 PRINT CHR$(4);"CLOSE";F$

9298 GOSUB 62408

9299 RETURN



9300 F$="COPYTANK"



9308 PRINT CHR$(4);"OPEN";F$
9309 PRINT CHR$(4);"DELETE";F$

9312 PRINT CHR$(4);"OPEN";F$
9320 PRINT CHR$(4);"WRITE";F$

9330 FOR I=XS TO X2
9340 FOR J=Y2 TO YS

9342 IF U=1 THEN PRINT B(I,J):B(I,J)=0:GOTO 9360

9350 PRINT B(I,J)

9360 NEXT J
9370 NEXT I
9380 PRINT CHR$(4);"CLOSE";F$

9398 GOSUB 62408

9399 RETURN




9400 F$="COPYTANK"



9408 PRINT CHR$(4);"OPEN";F$
9409 PRINT CHR$(4);"DELETE";F$

9412 PRINT CHR$(4);"OPEN";F$
9420 PRINT CHR$(4);"WRITE";F$

9430 FOR I=XS TO X2

9442 IF U=1 THEN PRINT B(I,Y2):B(I,Y2)=0:GOTO 9470

9450 PRINT B(I,Y2)

9470 NEXT I

9480 PRINT CHR$(4);"CLOSE";F$

9498 GOSUB 62408

9499 RETURN



9500 F$="COPYTANK"



9508 PRINT CHR$(4);"OPEN";F$
9509 PRINT CHR$(4);"DELETE";F$

9512 PRINT CHR$(4);"OPEN";F$
9520 PRINT CHR$(4);"WRITE";F$

9530 FOR I=X2 TO XS

9542 IF U=1 THEN PRINT B(I,Y2):B(I,Y2)=0:GOTO 9570

9550 PRINT B(I,Y2)

9570 NEXT I

9580 PRINT CHR$(4);"CLOSE";F$

9598 GOSUB 62408

9599 RETURN


9600 F$="COPYTANK"



9608 PRINT CHR$(4);"OPEN";F$
9609 PRINT CHR$(4);"DELETE";F$

9612 PRINT CHR$(4);"OPEN";F$
9620 PRINT CHR$(4);"WRITE";F$

9630 FOR I=YS TO Y2

9642 IF U=1 THEN PRINT B(X2,I):B(X2,I)=0:GOTO 9670

9650 PRINT B(X2,I)

9670 NEXT I

9680 PRINT CHR$(4);"CLOSE";F$

9698 GOSUB 62408

9699 RETURN


9700 F$="COPYTANK"



9708 PRINT CHR$(4);"OPEN";F$
9709 PRINT CHR$(4);"DELETE";F$

9712 PRINT CHR$(4);"OPEN";F$
9720 PRINT CHR$(4);"WRITE";F$

9730 FOR I=Y2 TO YS

9742 IF U=1 THEN PRINT B(X2,I):B(X2,I)=0:GOTO 9770

9750 PRINT B(X2,I)

9770 NEXT I

9780 PRINT CHR$(4);"CLOSE";F$

9798 GOSUB 62408

9799 RETURN



9800 F$="COPYTANK"



9808 PRINT CHR$(4);"OPEN";F$
9809 PRINT CHR$(4);"DELETE";F$

9812 PRINT CHR$(4);"OPEN";F$
9820 PRINT CHR$(4);"WRITE";F$

9842 IF U=1 THEN PRINT B(X2,Y2):B(X2,Y2)=0:GOTO 9880

9850 PRINT B(X2,Y2)

9880 PRINT CHR$(4);"CLOSE";F$

9898 GOSUB 62408

9899 RETURN


10000 F$="COPYTANK"



10006 REM 
10020 PRINT CHR$(4);"READ";F$+".INDEX"

10022 INPUT MS:INPUT NS:INPUT M2:INPUT N2

10024 PRINT CHR$(4);"CLOSE";F$+".INDEX"


10028 IF MS=0 AND M2=0 AND NS=0 AND N2=0 THEN RETURN

10030 IF MS=M2 AND NS=N2 THEN 11000

10032 IF MS<M2 AND NS=N2 THEN 11100
10034 IF MS>M2 AND NS=N2 THEN 11200
10036 IF MS=M2 AND NS<N2 THEN 11300
10038 IF MS=M2 AND NS>N2 THEN 11400

10042 IF MS<M2 AND NS<N2 THEN 12100
10044 IF MS>M2 AND NS>N2 THEN 12200
10046 IF MS>M2 AND NS<N2 THEN 12300
10048 IF MS<M2 AND NS>N2 THEN 12400




10090 END


11000 F$="COPYTANK"



11002 REM 
11003 PRINT CHR$(4);"READ";F$

11004 INPUT B(X2,Y2)

11010 GOSUB 14900

11060 PRINT CHR$(4);"CLOSE";F$


11090 RETURN


11100 F$="COPYTANK"




11102 REM 
11103 PRINT CHR$(4);"READ";F$

11104 FOR I=X2 TO X2+ABS(M2-MS)

11105 IF I<1 OR I>19 THEN INPUT B(0,0):GOTO 11109

11107 INPUT B(I,Y2)

11109 NEXT I

11160 PRINT CHR$(4);"CLOSE";F$

11170 GOSUB 14900

11190 RETURN


11200 F$="COPYTANK"




11202 REM 
11203 PRINT CHR$(4);"READ";F$

11204 FOR I=X2-ABS(MS-M2) TO X2

11205 IF I<1 OR I>19 THEN INPUT B(0,0):GOTO 11209

11207 INPUT B(I,Y2)

11209 NEXT I

11260 PRINT CHR$(4);"CLOSE";F$

11270 GOSUB 14900

11290 RETURN



11300 F$="COPYTANK"




11302 REM 
11303 PRINT CHR$(4);"READ";F$

11304 FOR I=Y2 TO Y2+ABS(NS-N2)

11305 IF I<1 OR I>79 THEN INPUT B(0,0):GOTO 11309

11307 INPUT B(X2,I)

11309 NEXT I

11360 PRINT CHR$(4);"CLOSE";F$

11370 GOSUB 14900

11390 RETURN





11400 F$="COPYTANK"



11402 REM 
11403 PRINT CHR$(4);"READ";F$

11404 FOR I=Y2-ABS(NS-N2) TO Y2

11405 IF I<1 OR I>79 THEN INPUT B(0,0):GOTO 11409

11407 INPUT B(X2,I)

11409 NEXT I

11460 PRINT CHR$(4);"CLOSE";F$

11470 GOSUB 14900

11490 RETURN



12100 F$="COPYTANK"




12102 REM 
12103 PRINT CHR$(4);"READ";F$

12104 FOR I=X2 TO X2+ABS(M2-MS)
12105 FOR J=Y2 TO Y2+ABS(N2-NS)

12106 IF I<1 OR I>19 THEN INPUT B(0,0):GOTO 12109
12107 IF J<1 OR J>79 THEN INPUT B(0,0):GOTO 12109


12108 INPUT B(I,J)

12109 NEXT J
12110 NEXT I

12160 PRINT CHR$(4);"CLOSE";F$

12170 GOSUB 14900

12190 RETURN


12200 F$="COPYTANK"




12202 REM 
12203 PRINT CHR$(4);"READ";F$

12204 FOR I=X2-ABS(MS-M2) TO X2
12205 FOR J=Y2-ABS(NS-N2) TO Y2

12206 IF I<1 OR I>19 THEN INPUT B(0,0):GOTO 12209
12207 IF J<1 OR J>79 THEN INPUT B(0,0):GOTO 12209


12208 INPUT B(I,J)

12209 NEXT J
12210 NEXT I

12260 PRINT CHR$(4);"CLOSE";F$

12270 GOSUB 14900

12290 RETURN



12300 F$="COPYTANK"




12302 REM 
12303 PRINT CHR$(4);"READ";F$

12304 FOR I=X2-ABS(MS-M2) TO X2
12305 FOR J=Y2 TO Y2+ABS(NS-N2)

12306 IF I<1 OR I>19 THEN INPUT B(0,0):GOTO 12309
12307 IF J<1 OR J>79 THEN INPUT B(0,0):GOTO 12309


12308 INPUT B(I,J)

12309 NEXT J
12310 NEXT I

12360 PRINT CHR$(4);"CLOSE";F$

12370 GOSUB 14900

12390 RETURN



12400 F$="COPYTANK"




12402 REM 
12403 PRINT CHR$(4);"READ";F$

12404 FOR I=X2 TO X2+ABS(MS-M2)
12405 FOR J=Y2-ABS(NS-N2) TO Y2

12406 IF I<1 OR I>19 THEN INPUT B(0,0):GOTO 12409
12407 IF J<1 OR J>79 THEN INPUT B(0,0):GOTO 12409


12408 INPUT B(I,J)

12409 NEXT J
12410 NEXT I

12460 PRINT CHR$(4);"CLOSE";F$

12470 GOSUB 14900

12490 RETURN









14900 BB=0

14902 FOR I=1 TO 19
14910 FOR J=1 TO 79
14920 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":BB=BB+1
14922 IF B(I,J)=0 THEN VTAB I:HTAB J:PRINT" "
14930 NEXT J
14940 NEXT I

14942 GOSUB 1200

14950 RETURN




15000 INVERSE:VTAB 23:HTAB 1:PRINT"                                                 ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL
15005 INVERSE:VTAB 23:HTAB 50:PRINT"SAVING":NORMAL
15007 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60

15009 IF LEN(F$) > 24 THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 15000



15012 PRINT CHR$(4);"OPEN";F$
15020 PRINT CHR$(4);"WRITE";F$ 
15030 FOR I=1 TO 19
15040 FOR J=1 TO 79
15050 PRINT B(I,J)
15060 NEXT J
15070 NEXT I
15072 PRINT CHR$(4);"CLOSE";F$

15074 X9=10:Y9=40:V8=10:V9=38:G1=0:MA=0

15075 M(1)=1:M(2)=2:M(3)=3:M(4)=4:M(5)=5:M(6)=6:M(7)=7:M(8)=8

15076 T$="R  DR  D  DL  L  UL  U  UR "


15081 PRINT CHR$(4);"OPEN";F$+".INDEX"
15082 PRINT CHR$(4);"WRITE";F$+".INDEX"
15083 PRINT X1:PRINT Y1:PRINT X9:PRINT Y9:PRINT V8:PRINT V9:PRINT G1:PRINT M(1):PRINT M(2):PRINT M(3):PRINT M(4):PRINT M(5):PRINT M(6):PRINT M(7):PRINT M(8):PRINT T$:PRINT MA
15084 PRINT CHR$(4);"CLOSE";F$+".INDEX"

15086 PRINT CHR$(4);"OPEN";F$+".BITMAP"
15088 PRINT CHR$(4);"WRITE";F$+".BITMAP" 
15090 FOR I=1 TO 19
15092 FOR J=1 TO 79
15093 PRINT B(I,J);
15094 NEXT J
15095 PRINT
15096 NEXT I
15097 PRINT CHR$(4);"CLOSE";F$+".BITMAP"

15098 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL
15099 GOTO 60

15100 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL
15105 INVERSE:VTAB 23:HTAB 50:PRINT"LOADING":NORMAL
15106 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60



15110 REM 
15120 PRINT CHR$(4);"READ";F$ 
15130 FOR I=1 TO 19
15140 FOR J=1 TO 79
15150 INPUT B(I,J)
15160 NEXT J
15170 NEXT I
15180 PRINT CHR$(4);"CLOSE";F$
15181 REM 
15182 PRINT CHR$(4);"READ";F$+".INDEX"
15183 INPUT X1:INPUT Y1:INPUT X9:INPUT Y9:INPUT V8:INPUT V9:INPUT G1:INPUT M(1):INPUT M(2):INPUT M(3):INPUT M(4):INPUT M(5):INPUT M(6):INPUT M(7):INPUT M(8):INPUT T$:INPUT MA
15184 PRINT CHR$(4);"CLOSE";F$+".INDEX"
15185 IF M(5)=0 THEN FOR I=1 TO 8:M(I)=I:NEXT I:T$="R  DR  D  DL  L  UL  U  UR "

15186 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL
15187 GOSUB 15200


15188 REM 

15189 NORMAL:VTAB 20:HTAB 45:PRINT"                     "
15190 LL=1:GOSUB 1200:GOTO 60

15200 BB=0:VTAB 20:HTAB 75:PRINT"    ":VTAB 21:HTAB 75:PRINT"   0":VTAB 22:HTAB 75:PRINT"   0" 
15202 FOR I=1 TO 19
15210 FOR J=1 TO 79
15220 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":BB=BB+1:GOSUB 1200
15222 IF B(I,J)<>1 THEN VTAB I:HTAB J:PRINT" "
15230 NEXT J
15240 NEXT I
15250 RETURN


15500 NORMAL:VTAB 20:HTAB 45:PRINT"                     ":INVERSE:VTAB 23:HTAB 66:PRINT"             ":NORMAL

15502 FOR I=1 TO 19
15510 FOR J=1 TO 79
15520 VTAB I:HTAB J:PRINT" "
15530 NEXT J
15540 NEXT I

15542 FOR I=0 TO 20
15543 FOR J=0 TO 80
15544 B(I,J)=0
15545 NEXT J
15546 NEXT I

15547 FOR I=0 TO 1510:C(I)=0:NEXT I

15548 BB=0
15549 VTAB 20:HTAB 75:PRINT"   0":VTAB 21:HTAB 75:PRINT"   0":VTAB 22:HTAB 75:PRINT"   0"
15550 GOTO 60

15800 HOME
15802 PRINT CHR$(4);"CATALOG"+",D2,S6"
15810 PRINT:PRINT"<PRESS ANY KEY TO BE CONTINUE>":NORMAL:GET CT$:PRINT CT$
15820 HOME:BB=0
15830 FOR I=1 TO 19
15840 FOR J=1 TO 79
15850 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":BB=BB+1
15860 NEXT J
15870 NEXT I

15880 IF D2=1 THEN D2=0:RETURN

15990 GOTO 52

22200 INVERSE:VTAB 23:HTAB 50:PRINT"ERROR OCCURED":NORMAL:FOR I=1 TO 50000:NEXT I:GOTO 60

 

24000 FOR I=1 TO 19
24010 FOR J=1 TO 79
24020 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":GOTO 24040
24030 VTAB I:HTAB J:PRINT" "
24040 NEXT J
24050 NEXT I

24060 RETURN

27000 S1=S1+1:N1=21:N2=78
27010 IF S1>9 THEN N2=N2-1
27020 IF S1>99 THEN N2=N2-1
27030 IF S1>999 THEN N2=N2-1
27040 VTAB N1:HTAB N2: PRINT S1
27050 RETURN



29000 IF X1=10 AND Y1=40 THEN 29040
29010 IF B(X1,Y1)=1 THEN NORMAL:VTAB X1:HTAB Y1:PRINT"$"
29020 IF B(X1,Y1)=0 THEN NORMAL:VTAB X1:HTAB Y1:PRINT" "
29030 IF X2=10 AND Y2=40 THEN 29050
29040 INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL
 

29050 RETURN


30000 XS=0:YS=0:X2=0:Y2=0:F$="COPYTANK":GOSUB 62408

30002 INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 50:PRINT"MAZE PAINTER  ":VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL

30010 IF A$="I" THEN I2=1:X2=10:Y2=42:GOTO 31000
30020 IF A$="O" THEN O2=1:X2=10:Y2=42:GOTO 31000
30021 IF A$="U" THEN U2=1:X2=10:Y2=42:GOTO 31000

30022 IF A$="F" THEN L2=1:X2=10:Y2=42:GOTO 31000


30040 IF A$=CHR$(43) THEN B(0,0)=0:INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOSUB 15200:GOSUB 1200:GOTO 60

30060 GOTO 30002

31000 VTAB 10:HTAB 40:PRINT"M":INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL

31002 IF L2=1 THEN INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                        ":VTAB 23:HTAB 50:PRINT"FILL         ":VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL:GOTO 31066

31003 IF U2=1 THEN INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                        ":VTAB 23:HTAB 50:PRINT"CUT          ":VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL:GOTO 31066

31004 IF O2=1 THEN INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                        ":VTAB 23:HTAB 50:PRINT"COPY         ":VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL:GOTO 31066


31006 INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 50:PRINT"INVERT":VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL

31066 IF A$=CHR$(25) THEN X2=X1-1:Y2=Y1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
31067 IF A$=CHR$(7) THEN X2=X1:Y2=Y1-1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
31068 IF A$=CHR$(8) THEN X2=X1:Y2=Y1+1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
31069 IF A$=CHR$(2) THEN X2=X1+1:Y2=Y1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2

31070 IF A$=CHR$(43) THEN O2=0:I2=0:L2=0:U2=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:VTAB 10:HTAB 40:PRINT"M":INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 30002

31080 IF A$="B" AND L2=1 THEN 50000

31081 IF A$="B" THEN 32000

31082 IF A$="D" AND O2=1 THEN GOSUB 10000:GOTO 31000
31084 IF A$="D" AND U2=1 THEN GOSUB 10000:GOTO 31000

31090 GOTO 31000


32000 INVERSE:VTAB X1:HTAB Y1:PRINT"B":B=1:XS=X1:YS=Y1:NORMAL

32010 INVERSE:VTAB 23:HTAB 11:GET A$:GOSUB 59000:VTAB 23:HTAB 11:PRINT A$:NORMAL

32066 IF A$=CHR$(25) THEN X2=X1-1:Y2=Y1:GOSUB 1000:GOSUB 49000:VTAB 10:HTAB 40:PRINT"M":GOSUB 40000:X1=X2:Y1=Y2
32067 IF A$=CHR$(7) THEN X2=X1:Y2=Y1-1:GOSUB 1000:GOSUB 49000:VTAB 10:HTAB 40:PRINT"M":GOSUB 40000:X1=X2:Y1=Y2
32068 IF A$=CHR$(8) THEN X2=X1:Y2=Y1+1:GOSUB 1000:GOSUB 49000:VTAB 10:HTAB 40:PRINT"M":GOSUB 40000:X1=X2:Y1=Y2
32069 IF A$=CHR$(2) THEN X2=X1+1:Y2=Y1:GOSUB 1000:GOSUB 49000:VTAB 10:HTAB 40:PRINT"M":GOSUB 40000:X1=X2:Y1=Y2

32070 IF A$=CHR$(43) THEN GOSUB 49000:INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 31000

32071 IF A$="C" AND O2=1 THEN O=1:GOSUB 40000:INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 31000
32072 IF A$="C" AND U2=1 THEN U=1:GOSUB 40000:GOSUB 49500:INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 31000


32076 IF A$="E" AND I2=1 THEN F=1:GOSUB 40000:GOSUB 49500:INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:VTAB 10:HTAB 40:PRINT"M":GOTO 31000

32080 GOTO 32010


33000 INVERSE:VTAB 23:HTAB 1:PRINT"                                                                              ":VTAB 23:HTAB 50:PRINT"MAZE FIXING":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL


33002 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60

33010 A9=10:B9=40:C8=10:D9=38:E1=0:FF=1

33012 N(1)=1:N(2)=2:N(3)=3:N(4)=4:N(5)=5:N(6)=6:N(7)=7:N(8)=8

33014 H$="R  DR  D  DL  L  UL  U  UR "


33081 REM 
33082 PRINT CHR$(4);"READ";F$+".INDEX"
33083 INPUT T1:INPUT T2
33084 PRINT CHR$(4);"CLOSE";F$+".INDEX"


33181 PRINT CHR$(4);"OPEN";F$+".INDEX"
33182 PRINT CHR$(4);"WRITE";F$+".INDEX"
33183 PRINT T1:PRINT T2:PRINT A9:PRINT B9:PRINT C8:PRINT D9:PRINT E1:PRINT N(1):PRINT N(2):PRINT N(3):PRINT N(4):PRINT N(5):PRINT N(6):PRINT N(7):PRINT N(8):PRINT H$:PRINT FF
33184 PRINT CHR$(4);"CLOSE";F$+".INDEX"

33186 INVERSE:VTAB 23:HTAB 50:PRINT"           ":VTAB 23:HTAB 12:PRINT"                              ":NORMAL

33190 GOTO 60








39000 IF X1=10 AND Y1=40 THEN 39040
39002 IF X1=XS AND Y1=YS THEN 39030
39010 IF B(X1,Y1)=1 THEN NORMAL:VTAB X1:HTAB Y1:PRINT"$"
39020 IF B(X1,Y1)=0 THEN NORMAL:VTAB X1:HTAB Y1:PRINT" "
39030 IF X2=10 AND Y2=40 THEN 39050
39040 INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL
 

39050 RETURN


40000 IF X2>XS AND Y2>YS THEN 40100
40010 IF X2<XS AND Y2<YS THEN 41100
40020 IF X2<XS AND Y2>YS THEN 42100
40030 IF X2>XS AND Y2<YS THEN 43100

40040 IF Y2=YS AND X2>XS THEN 44100
40050 IF Y2=YS AND X2<XS THEN 45100
40060 IF X2=XS AND Y2>YS THEN 46100
40070 IF X2=XS AND Y2<YS THEN 47100

40080 IF X2=XS AND Y2=YS THEN 48100

40090 RETURN



40100 INVERSE

40111 IF F=1 THEN NORMAL

40112 IF F=1 THEN FOR I=XS TO X2:FOR J=YS TO Y2:GOSUB 60000:NEXT J:NEXT I

40116 IF F=1 THEN F=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:GOTO 40142


40120 IF O=1 OR U=1 THEN GOSUB 62300
40122 IF O=1 OR U=1 THEN O=0:U=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":VTAB 23:HTAB 63:PRINT"DIRECTION : DR":NORMAL:GOSUB 24000:GOTO 40142

40137 FOR I=XS TO X2:VTAB I:HTAB YS:PRINT" ":NEXT I
40138 FOR I=XS TO X2:VTAB I:HTAB Y2:PRINT" ":NEXT I
40139 FOR J=YS TO Y2:VTAB XS:HTAB J:PRINT" ":NEXT J
40140 FOR J=YS TO Y2:VTAB X2:HTAB J:PRINT" ":NEXT J 

40141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

40142 NORMAL

40150 RETURN


41000 REM

41100 INVERSE


41111 IF F=1 THEN NORMAL

41112 IF F=1 THEN FOR I=XS TO X2 STEP -1:FOR J=YS TO Y2 STEP -1:GOSUB 60000:NEXT J:NEXT I

41116 IF F=1 THEN F=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:GOTO 41142


41120 IF O=1 OR U=1 THEN GOSUB 9100
41122 IF O=1 OR U=1 THEN O=0:U=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":VTAB 23:HTAB 63:PRINT"DIRECTION : UL":NORMAL:GOSUB 24000:GOTO 41142



41137 FOR I=XS TO X2 STEP -1:VTAB I:HTAB YS:PRINT" ":NEXT I
41138 FOR I=XS TO X2 STEP -1:VTAB I:HTAB Y2:PRINT" ":NEXT I
41139 FOR J=YS TO Y2 STEP -1:VTAB XS:HTAB J:PRINT" ":NEXT J
41140 FOR J=YS TO Y2 STEP -1:VTAB X2:HTAB J:PRINT" ":NEXT J 

41141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

41142 NORMAL
41150 RETURN


42100 INVERSE

42111 IF F=1 THEN NORMAL

42112 IF F=1 THEN FOR I=XS TO X2 STEP -1:FOR J=YS TO Y2:GOSUB 60000:NEXT J:NEXT I

42116 IF F=1 THEN F=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:GOTO 42142

42120 IF O=1 OR U=1 THEN GOSUB 9200
42122 IF O=1 OR U=1 THEN O=0:U=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":VTAB 23:HTAB 63:PRINT"DIRECTION : UR":NORMAL:GOSUB 24000:GOTO 42142


42137 FOR I=XS TO X2 STEP -1:VTAB I:HTAB YS:PRINT" ":NEXT I
42138 FOR I=XS TO X2 STEP -1:VTAB I:HTAB Y2:PRINT" ":NEXT I
42139 FOR J=YS TO Y2:VTAB XS:HTAB J:PRINT" ":NEXT J
42140 FOR J=YS TO Y2:VTAB X2:HTAB J:PRINT" ":NEXT J 

42141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

42142 NORMAL
42150 RETURN


43100 INVERSE

43111 IF F=1 THEN NORMAL

43112 IF F=1 THEN FOR I=XS TO X2:FOR J=YS TO Y2 STEP -1:GOSUB 60000:NEXT J:NEXT I

43116 IF F=1 THEN F=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":NORMAL:GOTO 43142


43120 IF O=1 OR U=1 THEN GOSUB 9300
43122 IF O=1 OR U=1 THEN O=0:U=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":VTAB 23:HTAB 63:PRINT"DIRECTION : DL":NORMAL:GOSUB 24000:GOTO 43142



43137 FOR I=XS TO X2:VTAB I:HTAB YS:PRINT" ":NEXT I
43138 FOR I=XS TO X2:VTAB I:HTAB Y2:PRINT" ":NEXT I
43139 FOR J=YS TO Y2 STEP -1:VTAB XS:HTAB J:PRINT" ":NEXT J
43140 FOR J=YS TO Y2 STEP -1:VTAB X2:HTAB J:PRINT" ":NEXT J 

43141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

43142 NORMAL
43150 RETURN


44100 INVERSE
 
44101 IF F=1 THEN NORMAL

44102 IF F=1 THEN FOR I=XS TO X2:GOSUB 62000:NEXT I

44104 IF F=1 THEN F=0:GOTO 44142


44106 IF O=1 OR U=1 THEN GOSUB 9400
44108 IF O=1 OR U=1 THEN O=0:U=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":VTAB 23:HTAB 63:PRINT"DIRECTION : D ":NORMAL:GOSUB 24000:GOTO 44142



44110 FOR I=XS TO X2:VTAB I:HTAB YS:PRINT" ":NEXT I

44141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

44142 NORMAL
44150 RETURN

45100 INVERSE

45101 IF F=1 THEN NORMAL
 
45102 IF F=1 THEN FOR I=XS TO X2 STEP -1:GOSUB 62000:NEXT I

45104 IF F=1 THEN F=0:GOTO 45142

45106 IF O=1 OR U=1 THEN GOSUB 9500
45108 IF O=1 OR U=1 THEN O=0:U=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":VTAB 23:HTAB 63:PRINT"DIRECTION : U ":NORMAL:GOSUB 24000:GOTO 45142



45110 FOR I=XS TO X2 STEP -1:VTAB I:HTAB YS:PRINT" ":NEXT I

45141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

45142 NORMAL
45150 RETURN

46100 INVERSE

46101 IF F=1 THEN NORMAL

46102 IF F=1 THEN FOR J=YS TO Y2:GOSUB 62200:NEXT J

46104 IF F=1 THEN F=0:GOTO 46142

46106 IF O=1 OR U=1 THEN GOSUB 9600
46108 IF O=1 OR U=1 THEN O=0:U=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":VTAB 23:HTAB 63:PRINT"DIRECTION : R ":NORMAL:GOSUB 24000:GOTO 46142


46110 FOR J=YS TO Y2:VTAB XS:HTAB J:PRINT" ":NEXT J

46141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

46142 NORMAL
46150 RETURN



47100 INVERSE

47101 IF F=1 THEN NORMAL

47102 IF F=1 THEN FOR J=YS TO Y2 STEP -1:GOSUB 62200:NEXT J
 
47104 IF F=1 THEN F=0:GOTO 47142

47106 IF O=1 OR U=1 THEN GOSUB 9700
47108 IF O=1 OR U=1 THEN O=0:U=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":VTAB 23:HTAB 63:PRINT"DIRECTION : L ":NORMAL:GOSUB 24000:GOTO 47142


47110 FOR J=YS TO Y2 STEP -1:VTAB XS:HTAB J:PRINT" ":NEXT J

47141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

47142 NORMAL
47150 RETURN

48100 INVERSE

48101 IF F=1 THEN NORMAL

48102 IF F=1 THEN GOSUB 61000

48104 IF F=1 THEN F=0:GOTO 48142

48106 IF O=1 OR U=1 THEN GOSUB 9800
48108 IF O=1 OR U=1 THEN O=0:U=0:INVERSE:VTAB X1:HTAB Y1:PRINT"$":VTAB 23:HTAB 63:PRINT"DIRECTION : O ":NORMAL:GOSUB 24000:GOTO 48142


48110 VTAB XS:HTAB YS:PRINT" "

48141 VTAB XS:HTAB YS:PRINT"B":VTAB X2:HTAB Y2:PRINT"E"

48142 NORMAL
48150 RETURN


49000 FOR I=1 TO 19
49010 FOR J=1 TO 79
49020 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":GOTO 49040
49030 VTAB I:HTAB J:PRINT" "
49040 NEXT J
49050 NEXT I
49060 RETURN

49500 BB=0

49502 FOR I=1 TO 19
49510 FOR J=1 TO 79
49520 IF B(I,J)=1 THEN BB=BB+1
49530 NEXT J
49540 NEXT I

49542 GOSUB 1200

49550 RETURN


50000 IF B(X1,Y1)=1 THEN 31000

50002 FOR I=0 TO 1510:C(I)=0:NEXT I

50004 GOSUB 51000

50006 XZ=X1:YZ=Y1

50008 C1=1:C2=1

50010 IF B(XZ-1,YZ)=0 THEN C(C2)=100*(XZ-1)+YZ:VTAB XZ-1:HTAB YZ:PRINT"$":B(XZ-1,YZ)=1:C2=C2+1
50020 IF B(XZ-1,YZ+1)=0 THEN C(C2)=100*(XZ-1)+YZ+1:VTAB XZ-1:HTAB YZ+1:PRINT"$":B(XZ-1,YZ+1)=1:C2=C2+1
50030 IF B(XZ,YZ+1)=0 THEN C(C2)=100*(XZ)+YZ+1:VTAB XZ:HTAB YZ+1:PRINT"$":B(XZ,YZ+1)=1:C2=C2+1
50040 IF B(XZ+1,YZ+1)=0 THEN C(C2)=100*(XZ+1)+YZ+1:VTAB XZ+1:HTAB YZ+1:PRINT"$":B(XZ+1,YZ+1)=1:C2=C2+1
50050 IF B(XZ+1,YZ)=0 THEN C(C2)=100*(XZ+1)+YZ:VTAB XZ+1:HTAB YZ:PRINT"$":B(XZ+1,YZ)=1:C2=C2+1
50060 IF B(XZ+1,YZ-1)=0 THEN C(C2)=100*(XZ+1)+YZ-1:VTAB XZ+1:HTAB YZ-1:PRINT"$":B(XZ+1,YZ-1)=1:C2=C2+1
50070 IF B(XZ,YZ-1)=0 THEN C(C2)=100*(XZ)+YZ-1:VTAB XZ:HTAB YZ-1:PRINT"$":B(XZ,YZ-1)=1:C2=C2+1
50080 IF B(XZ-1,YZ-1)=0 THEN C(C2)=100*(XZ-1)+YZ-1:VTAB XZ-1:HTAB YZ-1:PRINT"$":B(XZ-1,YZ-1)=1:C2=C2+1

50090 IF C1=C2 THEN GOSUB 52000::GOSUB 49500:GOTO 31000


50100 ZZ=C(C1)

50110 XZ=INT(ZZ/100):YZ=ZZ-100*XZ:C1=C1+1:GOTO 50010



51000 FOR I=0 TO 80

51010 B(0,I)=1:B(20,I)=1
51020 NEXT I

51030 FOR J=0 TO 20
51040 B(J,0)=1:B(J,80)=1
51050 NEXT J

51060 RETURN


52000 FOR I=0 TO 80

52010 B(0,I)=0:B(20,I)=0
52020 NEXT I

52030 FOR J=0 TO 20
52040 B(J,0)=0:B(J,80)=0
52050 NEXT J


52060 RETURN


58000 GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
58010 RETURN

58100 GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL:VTAB X1:HTAB Y1:PRINT"$":GOSUB 1100:B(X1,Y1)=1:GOSUB 1200:X1=X2:Y1=Y2
58110 RETURN

58200 GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL:VTAB X1:HTAB Y1:PRINT" ":GOSUB 1150:B(X1,Y1)=0:GOSUB 1200:X1=X2:Y1=Y2
58210 RETURN


59000 IF A$=CHR$(10) OR A$=CHR$(13) OR A$=CHR$(22) OR A$=CHR$(12) OR A$=CHR$(11) OR A$=CHR$(17) OR A$=CHR$(23) OR A$=CHR$(21) OR A$=CHR$(27) THEN A$=" "
59002 RETURN



60000 IF B(I,J)=1 THEN B(I,J)=0:NORMAL:VTAB I:HTAB J:PRINT" ":GOTO 60060
60010 IF B(I,J)=0 THEN B(I,J)=1:NORMAL:VTAB I:HTAB J:PRINT"$"

60060 RETURN


61000 IF B(XS,YS)=1 THEN B(XS,YS)=0:NORMAL:VTAB XS:HTAB YS:PRINT" ":GOTO 61060
61010 IF B(XS,YS)=0 THEN B(XS,YS)=1:NORMAL:VTAB XS:HTAB YS:PRINT"$"

61060 RETURN


62000 IF B(I,Y2)=1 THEN B(I,Y2)=0:NORMAL:VTAB I:HTAB Y2:PRINT" ":GOTO 62060
62010 IF B(I,Y2)=0 THEN B(I,Y2)=1:NORMAL:VTAB I:HTAB Y2:PRINT"$"
62060 RETURN
 

62200 IF B(X2,J)=1 THEN B(X2,J)=0:NORMAL:VTAB X2:HTAB J:PRINT" ":GOTO 62260
62210 IF B(X2,J)=0 THEN B(X2,J)=1:NORMAL:VTAB X2:HTAB J:PRINT"$"
62260 RETURN


62300 F$="COPYTANK"



62308 PRINT CHR$(4);"OPEN";F$
62309 PRINT CHR$(4);"DELETE";F$

62312 PRINT CHR$(4);"OPEN";F$
62320 PRINT CHR$(4);"WRITE";F$

62330 FOR I=XS TO X2
62340 FOR J=YS TO Y2
62342 IF U=1 THEN PRINT B(I,J):B(I,J)=0:GOTO 62360
62350 PRINT B(I,J)
62360 NEXT J
62370 NEXT I
62380 PRINT CHR$(4);"CLOSE";F$

62398 REM 

62408 PRINT CHR$(4);"OPEN";F$+".INDEX"
62409 PRINT CHR$(4);"DELETE";F$+".INDEX"

62412 PRINT CHR$(4);"OPEN";F$+".INDEX"
62420 PRINT CHR$(4);"WRITE";F$+".INDEX"

62422 PRINT XS:PRINT YS:PRINT X2:PRINT Y2

62424 PRINT CHR$(4);"CLOSE";F$+".INDEX"

62426 RETURN

 
